package la.bbs558.service.impl;

import cn.hutool.core.lang.Snowflake;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import la.bbs558.dao.UserVisitCollectDao;
import la.bbs558.entity.UserVisitCollect;
import la.bbs558.service.UserVisitCollectService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 用户访问收集表(UserVisitCollect)表服务实现类
 *
 * @author makejava
 * @since 2024-01-22 14:50:24
 */
@Service("userVisitCollectService")
public class UserVisitCollectServiceImpl extends ServiceImpl<UserVisitCollectDao, UserVisitCollect> implements UserVisitCollectService {

    @Resource
    private Snowflake snowflake;

    @Override
    public void insertOrUpdate(UserVisitCollect userVisitCollect) {
        userVisitCollect.setId(snowflake.nextId());
        getBaseMapper().insertOrUpdate(userVisitCollect);
    }
}

